/**
 * 
 */
package gui.listener;

import java.util.EventListener;

import gui.GUIMaster;
import handwritten.gesture.HandInputManager;

/**
 * @author Louis
 *
 */
public abstract class InputListener{
	
	private GUIMaster guiMaster = null;
	
	public abstract EventListener create(GUIMaster guiMaster);
	
	protected InputListener(GUIMaster guiMaster){
		this.guiMaster = guiMaster;
	}
	
	protected void inputPressed(int x, int y){
		HandInputManager.getInstance().beginGesture(x, y);
		guiMaster.repaint();
	}
	
	protected void inputReleased(int x, int y){
		HandInputManager.getInstance().endGesture();
		guiMaster.repaint();
	}
	
	protected void inputDragged(int x, int y){
		HandInputManager.getInstance().continueGesture(x, y);
		guiMaster.repaint();
	}
	
	protected void inputDeviceResized(int width, int height){
		HandInputManager.getInstance().inputDeviceResized(width, height);
		guiMaster.repaint();
	}

}
